broken_keys=raw_input()
inputs=raw_input()
broken_keys += broken_keys.lower()
outputs=inputs
if '+' in broken_keys:
    broken_keys+='QWERTYUIOPLKJHGFDSAZXCVBNM'
for e in inputs:
    if e in broken_keys:
        outputs = outputs.replace(e,'')

print outputs